;;---------------------------------------------
; f1 -> f12
;;
(global-set-key [f3] 'other-window)
(global-set-key [f4] 'delete-window) 
(global-set-key [f9] 'ibuffer)
(global-set-key [f10] 'bookmark-bmenu-list)
(global-set-key [f11] 'diredp-dired-files) 
(global-set-key [f12] 'close-current-buffer)
(global-set-key (kbd "C-<f12>") 'open-last-closed)

;;---------------------------------------------
; Misc
;;
(global-set-key (kbd "C-x r a") 'append-to-register)
;;auto-complete
(global-set-key (kbd "C-x a f") 'ac-complete-filename)
(global-set-key (kbd "C-x a w") 'ac-complete-files-in-current-dir)

;;---------------------------------------------
; Edit, Move and Selection
;;
(global-set-key (kbd "M-h w") 'shrink-whitespaces)
(global-set-key (kbd "M-h d") 'comment-dwim)
(global-set-key (kbd "M-h t") 'toggle-letter-case)
(global-set-key (kbd "M-h c") 'compact-uncompact-block)
(global-set-key (kbd "M-h e") 'extend-selection)
(global-set-key (kbd "M-h q") 'select-text-in-quote)

(global-set-key (kbd "M-u") 'zap-to-char)
;(global-set-key (kbd "M-h M-h") ')

(global-set-key (kbd "M-l") 'end-of-buffer)
(global-set-key (kbd "M-L") 'beginning-of-buffer)
(global-set-key (kbd "M-'") 'backward-paragraph)
(global-set-key (kbd "M-,") 'forward-paragraph)

(global-set-key (kbd "M-SPC") 'set-mark-command)
(global-set-key (kbd "M-;") 'undo)
(global-set-key (kbd "C-o") 'open-next-line)
(global-set-key (kbd "M-o") 'open-previous-line)


;;---------------------------------------------
; Buffer List, Select, Manage
;;
(global-set-key (kbd "M-g n") 'new-empty-buffer)
(global-set-key (kbd "M-g a") 'pinbar-add)
(global-set-key (kbd "M-g d") 'pinbar-del)

(global-set-key (kbd "M-+") 'new-empty-buffer)

(global-set-key (kbd "M-[") 'swbuff-switch-to-previous-buffer)
(global-set-key (kbd "M-]") 'swbuff-switch-to-next-buffer)
(global-set-key (kbd "M-g i") 'ibuffer)
(global-set-key (kbd "M-\\") 'pinbar-add)

